﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
//using TestForm;

namespace 电子病历
{
    public partial class frmFather : Form
    {
        public frmFather()
        {
            InitializeComponent();
        }
        string constr = ConfigurationManager.ConnectionStrings["EMR"].ConnectionString;
        private void frmFather_Load(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(constr);
            conn.Open();
            string sql = "select djh as 住院号,zyrq as 入院日期,cyrq as 出院日期,cw_id as 床位,hz_id as 患者ID,xm as 患者姓名,days as 住院天数,ryzd as 入院诊断 from h_zyxx inner join h_huanz on h_huanz.id=h_zyxx.hz_id";
            SqlDataAdapter sda = new SqlDataAdapter(sql, conn);
            DataTable dt = new DataTable();
            sda.Fill(dt);
            dataGridView1.DataSource = dt;
            conn.Close();
        }

        private void 三测记录录入ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //MainForm lr = new MainForm();
            //lr.ShowDialog();
        }

        private void 病案首页ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DataGridViewRow dgvr = this.dataGridView1.SelectedRows[0];
            chuanzhi.hz_cwh = dgvr.Cells[0].Value.ToString();
            Form1 f1 = new Form1();
            f1.ShowDialog();
        }
    }
}
